<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .dad {
      width: 400px;
      height: 400px;
      background-color: pink;
    }

    .baby {
      width: 200px;
      height: 200px;
      background-color: purple;
    }
  </style>
</head>

<body>
  <div class="dad">
    <div class="baby"></div>
  </div>
  <script>
    const dad = document.querySelector('.dad')
    const baby = document.querySelector('.baby')
    dad.addEventListener('mouseover', function () {
      console.log('鼠标移入dad')
    })
    dad.addEventListener('mouseout', function () {
      console.log('鼠标移出dad')
    })

    baby.addEventListener('mouseover', function () {
      console.log('鼠标移入baby')
    })
    baby.addEventListener('mouseout', function () {
      console.log('鼠标移出baby')
    })


  </script>
</body>

</html>